/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package ria.impl;

import java.util.Collection;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.util.EObjectResolvingEList;

import ria.Event;
import ria.RiaPackage;
import ria.WControl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>WControl</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link ria.impl.WControlImpl#getWEvents <em>WEvents</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class WControlImpl extends WidgetImpl implements WControl {
	/**
	 * The cached value of the '{@link #getWEvents() <em>WEvents</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getWEvents()
	 * @generated
	 * @ordered
	 */
	protected EList<Event> wEvents;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected WControlImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return RiaPackage.Literals.WCONTROL;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Event> getWEvents() {
		if (wEvents == null) {
			wEvents = new EObjectResolvingEList<Event>(Event.class, this, RiaPackage.WCONTROL__WEVENTS);
		}
		return wEvents;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case RiaPackage.WCONTROL__WEVENTS:
				return getWEvents();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case RiaPackage.WCONTROL__WEVENTS:
				getWEvents().clear();
				getWEvents().addAll((Collection<? extends Event>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case RiaPackage.WCONTROL__WEVENTS:
				getWEvents().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case RiaPackage.WCONTROL__WEVENTS:
				return wEvents != null && !wEvents.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //WControlImpl
